/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BO;

import Bean.AccountBean;
import Bean.CartBean;
import java.sql.SQLException;
import java.util.List;

/**
 *
 * @author Quang Thao
 */
public class CartBO {
    
    public int Add(Bean.CartBean cart) throws Exception
    {
        Mapper.CartMapper map = new Mapper.CartMapper();
        int update = map.Add(cart);
        map.closeConnection();
        return update;
    }
    
    public String GetNewID() throws Exception
    {
        Mapper.CartMapper map = new Mapper.CartMapper();
        String newid = map.GetNewID();
        map.closeConnection();
        return newid;
    }

    public List GetListByType(String type) throws Exception
    {
        Mapper.CartMapper map = new Mapper.CartMapper();
        List list = map.GetListByType(type);
        map.closeConnection();
        return list;
    }
    public List GetCartDetail(String type) throws Exception
    {
        Mapper.CartMapper map = new Mapper.CartMapper();
        List list = map.GetCartDetail(type);
        map.closeConnection();
        return list;
    }
    public List GetAll() throws Exception
    {
        Mapper.CartMapper map = new Mapper.CartMapper();
        List list = map.GetAll();
        map.closeConnection();
        return list;
    }
     public int Delete(CartBean cart) throws Exception {
        Mapper.CartMapper map = new Mapper.CartMapper();
        int update = map.Delete(cart);
        map.closeConnection();
        return update;
    }
     public int UpdateSell(Bean.CartBean cart) throws Exception {
        Mapper.CartMapper map = new Mapper.CartMapper();
        int updatesell = map.UpdateSell(cart);
        map.closeConnection();
        return updatesell;
    }
}
